package com.xx.springboot.designPattern.DecoratorMode;/**
 * Created by xiaoxiunique on 2018-11-14.
 */

/**
 * <p>
 * TODO:装饰者模式 真正的装饰者
 * </p>
 *
 * @author hcg
 * @date 2018-11-14 11:23
 * @className Mocha
 */
public class Mocha extends CondimentDecorator {

    Beverage beverage;

    public Mocha(Beverage beverage) {
        this.beverage = beverage;
    }

    @Override
    public String getDescription() {
        return beverage.getDescription() + ", mocha";
    }

    @Override
    public double cost() {
        return .2 + beverage.cost();
    }
}
